package com.lengyu.iottransfer.gateway.common;

import lombok.Data;
import lombok.Getter;

@Data
public class BaseConstant {
    public enum BaseConfig{

        DEFAULT_SIZE(10),

        DEFAULT_PAGE(1);

        private Integer val;

        BaseConfig (Integer val){

            this.val = val;

        }

    }

    @Getter
    public enum User {

        GROUP_TYPE_USER("用户组",0),

        GROUP_TYPE_ADMIN("管理组",1);

        private Integer val ;

        private String name ;

        User(String name , Integer val){

            this.name = name ;

            this.val = val;

        }

    }

    @Getter
    public enum Oauth{

        TOKEN_PREFIX("Bearer "),

        HEADER_PARAM("Authorization");

        private String val;

        Oauth(String val){

            this.val = val;

        }

    }

    @Getter
    public  enum Returns {

        SUCCESS(200, "成功"),

        TIMEOUT(201, "请求超时,或许是服务器原因"),

        FAIL(202, "请求失败"),

        PARAM_ERRO(203,"参数传输错误"),

        NOTAUTH(300, "无权限请求"),

        TOKEN_PARSE_FAILED(301,"Token校验失败"),

        TOKEN_Expired(302,"Token令牌过期"),

        UNKNOWN_ERROER(800,"未知错误");

        private Integer code;

        private String status;

        private Returns(Integer code, String status) {

            this.code = code;

            this.status = status;

        }

    }

    @Getter
    public enum ReturnMessage{
        PARAM_NOT_NULL("必要参数不能为空"),

        USER_OR_PWD_ERR("帐号或密码错误,登录失败"),

        NOT_FOUND_TOKEN("没有携带Token,或者是Token校验失败"),

        NOT_OAUTH_REQUEST("没有权限访问");

        private  String val ;
        ReturnMessage (String val){

            this.val = val;
        }

    }
}
